Prior to this lecture, you should have read chapter 4 of Regression and Other Stories.
I have a data set of commute times based on a random sample of 100 California households. Based on that sample, I can calculate an average commute time, but if I had sampled a different set of 100 households from the same population, I could have gotten a slightly different average.
All of these averages will tend to be clustered around the actual population average, even if none of them will be exactly equal to the population average. In fact, if I sampled 100 households a whole bunch of times, the average of all those averages would be normally distributed, with an average at the population mean.
A one-sample t-test uses the mean and standard deviation of a sample to calculate a confidence interval for the population mean - a range of values that the the real average of the population probably falls within.
You can also calculate confidence interval for the population mean in Excel by following a couple steps.
First, you would calculate the standard deviation and average of your sample data. Then, use the CONFIDENCE.T() function to calculate the margin for the confidence interval using three arguments: alpha (one minus the confidence level), the standard deviation, and the sample size (in the example below, I use the COUNT() function to get the sample size). The confidence interval is the sample mean, plus or minus this value.
Three things influence a the width of a confidence interval:
You can also use a one-sample t-test to calculate the confidence interval for the proportion of the population that falls into a category. Here is how I would find the 90 percent confidence interval for the proportion of the population that commutes by car.
You can also calculate the 95-percent confidence interval for the average within each of several categories.